<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// Route::get('/', 'HomeController@root');

Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');
// // 增(create)
// Route::post('projects/store', 'ProjectsController@store')->name('projects.store');
// // 删(delete)
// Route::delete('projects/{project}', 'ProjectsController@destory')->name('projects.destory');
// // 改(update)
// Route::patch('projects/{project}', 'ProjectsController@update')->name('projects.update');
// // 查(show)

// Route::get('projects/{project}', 'ProjectsController@show')->name('projects.show');
Route::get('/', 'ProjectsController@index');
Route::resource('projects', 'ProjectsController');
Route::get('tasks/search', 'TasksController@search');
Route::get('tasks/charts', 'TasksController@charts')->name('tasks.charts');
Route::resource('tasks', 'TasksController');
Route::post('tasks/{task}/steps/complete', 'StepController@completeAll');
Route::delete('tasks/{task}/steps/clear', 'StepController@clear');

Route::resource('tasks.steps', 'StepController');

Route::post('tasks/{id}/check', 'TasksController@check')->name('tasks.check');
